1
Hexadecimal Notation and the Virtual Address Space
AI031 Lesson 2
00:00

Step into the Machine-Level Program View, where the complexity of hardware is abstracted into a structured Virtual Address Space. In this view, memory is not a collection of variables, but a massive, contiguous array of 8-bit blocks called bytes. For a machine with a $w$-bit word size, these addresses range from $0$ to $2^w - 1$, defining the limits of the program's reach.

1. The Power of 16

Binary is the language of circuits, but Hexadecimal Notation is the language of programmers. Because $16 = 2^4$, a single hex digit (0–F) maps perfectly to a 4-bit nibble. This allows a 1-byte value to be expressed compactly by exactly two digits (e.g., 0xFF). This shorthand is essential for reading machine code and assembly code, such as the instruction 4004dc: 48 03 47 28.

Figure 2.2: Hexadecimal-Binary-Decimal Mapping Hex Dec Bin 0 1 ... 9 A B C D E F 0 1 ... 9 10 11 12 13 14 15 0000 0001 ... 1001 1010 1011 1100 1101 1110 1111 Rule: To convert Dec x to Hex, repeatedly compute x = q ⋅ 16 + r

2. Precision and Arithmetic

As we manipulate Integral Data Types, we encounter Boolean rings and Two's-complement logic. We must navigate Little endian storage, Integer overflow, and the nuances of single precision floating point where Infinity ($+\infty$) and NaN reside. Understanding these bit patterns is the first step in mastering Arbitrary size arithmetic and robust systems programming.

main.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute.
>